/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Verito Ramirez
 *         Victor Jaramillo
 */
@Entity
@Table(name = "cxp_tipodocumento")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CxpTipoDocumento.findAll", query = "SELECT s FROM CxpTipoDocumento s"),
    @NamedQuery(name = "CxpTipoDocumento.findBycxpCodigoTipDoc", query = "SELECT s FROM CxpTipoDocumento s WHERE s.cxpCodigoTipDoc = :cxpCodigoTipDoc"),
    @NamedQuery(name = "CxpTipoDocumento.findBycxpNombreTipDoc", query = "SELECT s FROM CxpTipoDocumento s WHERE s.cxpNombreTipDoc = :cxpNombreTipDoc")})
public class CxpTipoDocumento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CXP_CODIGO_TIPDOC")
    private String cxpCodigoTipDoc;
    @Size(max = 45)
    @Column(name = "CXP_NOMBRE_TIPDOC")
    private String cxpNombreTipDoc;
    
    
    public CxpTipoDocumento() {
    }
    
    public CxpTipoDocumento(String cxpCodigoTipDoc) {
        this.cxpCodigoTipDoc = cxpCodigoTipDoc;
    }

    public CxpTipoDocumento(String cxpCodigoTipDoc, String cxpNombreTipDoc) {
        this.cxpCodigoTipDoc = cxpCodigoTipDoc;
        this.cxpNombreTipDoc = cxpNombreTipDoc;
    }

    public String getCxpCodigoTipDoc() {
        return cxpCodigoTipDoc;
    }

    public void setCxpCodigoTipDoc(String cxpCodigoTipDoc) {
        this.cxpCodigoTipDoc = cxpCodigoTipDoc;
    }

    public String getCxpNombreTipDoc() {
        return cxpNombreTipDoc;
    }

    public void setCxpNombreTipDoc(String cxpNombreTipDoc) {
        this.cxpNombreTipDoc = cxpNombreTipDoc;
    }

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cxpCodigoTipDoc != null ? cxpCodigoTipDoc.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CxpTipoDocumento)) {
            return false;
        }
        CxpTipoDocumento other = (CxpTipoDocumento) object;
        if ((this.cxpCodigoTipDoc == null && other.cxpCodigoTipDoc != null) || (this.cxpCodigoTipDoc != null && !this.cxpCodigoTipDoc.equals(other.cxpCodigoTipDoc))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "clases.CxpTipoDocumento[ cxpCodigoTipDoc=" + cxpCodigoTipDoc + " ]";
    }
    
}
